﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using YLPublicService.TransferModel;

namespace YLClient.BLL
{
    /// <summary>
    /// 将模板xml 转换为对象，方便塞选
    /// </summary>
    public class WorkItemEx : WorkItem, IWorkItem
    {
        public TemplateItem.TemplateDetial DetialObject { get; set; }
        public WorkItemEx(WorkItem workitem)
        {
            this.TemplateID = workitem.TemplateID;
            this.TemplateName = workitem.TemplateName;
            this.WorkItemID = workitem.WorkItemID;
            this.Status = workitem.Status;
            this.Detial = workitem.Detial;
            this.DBTime = workitem.DBTime;
            this.DetialObject = TemplateItem.TemplateDetial.FromXML(workitem.Detial);
        }
        public WorkItem CastToSerialization()
        {
            WorkItem workitem = new WorkItem();
            workitem.TemplateID = this.TemplateID;
            workitem.TemplateName = this.TemplateName;
            workitem.WorkItemID = this.WorkItemID;
            workitem.Status = this.Status;
            workitem.Detial = this.Detial;
            workitem.DBTime = this.DBTime;
            return workitem;
        }
    }
}
